#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include<QListWidgetItem>
#include<danmuflie.h>


class VlcInstance;
class VlcMedia;
class VlcMediaPlayer;
class VlcMediaListPlayer;
class VlcMediaList;
class VlcAudio;
QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    void keyPressEvent(QKeyEvent* event) override;
    ~Widget();
signals:
    void timeToFire(qint64 time);

private slots:
    void loadDanmuToFire(qint64 time);
    void checkPostion(qint64 pos);
    void on_pushButton_clicked();

    void on_pushButton_2_clicked();

    void on_pushButton_3_clicked();

    void on_pushButton_4_clicked();



    void on_playlist_itemDoubleClicked();

    void on_speedbox_currentIndexChanged(int index);





    void on_volumnsld_valueChanged(int value);

    void on_volumnbtn_clicked(bool checked);



    void on_pushButton_5_clicked();

    void on_pushButton_6_clicked();

    void on_pushButton_7_clicked();

    void on_onlineBtn_clicked();



private:
    Ui::Widget *ui;
    VlcInstance *m_instance;

        VlcMediaPlayer *m_player;
     VlcMediaListPlayer* m_playlist;
     VlcMediaList* m_mediaList;
    VlcAudio* vlcAudio;



    DanmuFlie danmufile;
    QString curName;
    int danMuIndex=0;
    QMap<int,QString>::const_iterator iter;//这个迭代器只负责读取map中的弹幕信息，不负责修改，使用只读迭代器


    // QWidget interface
protected:
    void resizeEvent(QResizeEvent *event) override;

    // QWidget interface
protected:
    virtual void dragEnterEvent(QDragEnterEvent *event) override;

    // QWidget interface
protected:
    virtual void dropEvent(QDropEvent *event) override;
};
#endif // WIDGET_H
